import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import viteSvgIcons from "vite-plugin-svg-icons";
import { resolve } from "path";

import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";

export default defineConfig({
  server: {
    port: 3000
  },
  plugins: [
    vue(),
    viteSvgIcons({
      iconDirs: [resolve("src/assets/svg")],
      symbolId: "icon-[dir]-[name]"
    }),
    AutoImport({
      resolvers: [ElementPlusResolver()]
    }),
    Components({
      resolvers: [ElementPlusResolver()]
    })
  ],
  resolve: {
    alias: {
      "@": resolve("src"),
      img: resolve("src/assets/images")
    }
  }
});
